//
//  AlbumCategoryModel.swift
//  YCCamera
//
//  Created by Billy on 3/7/25.
//

import UIKit
import Photos

// MARK: - Models

class AlbumCategoryModel {
    let id: String // 使用相册的localIdentifier作为唯一标识
    let title: String
    let collection: PHAssetCollection?
    let fetchOptions: PHFetchOptions
    var isSelected: Bool
    var count: Int
    
    init(collection: PHAssetCollection? = nil, title: String, id: String, isSelected: Bool = false) {
        self.collection = collection
        self.title = title
        self.id = id
        self.isSelected = isSelected
        self.count = 0
        
        // 创建默认的排序选项 - 按创建日期降序排列
        let options = PHFetchOptions()
        options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
        self.fetchOptions = options
    }
}
